package com.xoa.controller.party;


import com.xoa.model.party.Trash;
import com.xoa.service.party.TrashService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.beans.Transient;

@Controller
@RequestMapping("/TrashController")
public class TrashController {
    @Autowired
    private TrashService trashService;
    /**
     * 查询
     * @param page
     * @param pageSize
     * @param
     * @return
     */
    @RequestMapping("/selectTrash")
    @ResponseBody
    public ToJson selectTrash(Integer page, Integer pageSize, Integer tid, boolean useFlag, String codeNo){
            return  trashService.selectTrash(page,pageSize,tid,useFlag,codeNo);
    }

    /**
     * 删除
     * @param tid
     * @return
     */
    @RequestMapping("/deleteTrash")
    @ResponseBody
    public ToJson delete(Integer tid){
        return  trashService.delete(tid);
    }

    /**
     * 修改
     * @param trash
     * @return
     */
    @RequestMapping("/updateTrash")
    @ResponseBody
    public ToJson update(Trash trash){
            return trashService.update(trash);
    }

    /**
     * 添加
     */
    @RequestMapping("/addTrash")
    @ResponseBody
    public ToJson add(Trash trash){
            return trashService.add(trash);
    }


    @RequestMapping("/ecoudInsert")
    @ResponseBody
    @Transient
    public ToJson ecoudInsert(MultipartFile file){
        return trashService.ecoudInsert(file);
    }
}
